# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: my_dialog.py
  @time: 2021/6/7 9:34
  @desc:
"""

import sys
from PySide6.QtWidgets import (QApplication, QWidget, QVBoxLayout, QLineEdit)
from wiggle_widget import WiggleWidget
from my_marquee import MyMarquee


class MyDialog(QWidget):
    def __init__(self, parent=None):
        super(MyDialog, self).__init__(parent)
        layout = QVBoxLayout()
        my_marquee = MyMarquee()
        wiggle = WiggleWidget(parent)
        lineEdit = QLineEdit()
        lineEdit.setText("Hello Pyside6")
        layout.addWidget(wiggle)
        layout.addWidget(lineEdit)
        layout.addWidget(my_marquee)
        self.setLayout(layout)
        lineEdit.textChanged.connect(wiggle.set_text)
        self.setWindowTitle("Wiggly")
        self.resize(360, 145)


if __name__ == "__main__":
    app = QApplication(sys.argv)
    dialog = MyDialog()
    dialog.show()
    sys.exit(app.exec())
